package com.aspose.cells;

import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator;

class zaev {
   private static char[] a = new char[]{' ', '\n', '\r'};
   private Workbook b;
   private WorksheetCollection c;
   private Worksheet d;
   private Cell e;
   private Cells f;
   private HashMap g;
   private HashMap h;
   private Style i;
   private Style j;
   private ArrayList k;
   private int l = 0;
   private ArrayList m;
   private zafe n;
   private String o = "#A0A0A0";
   private String p = "15.0pt";
   private HTMLLoadOptions q = new HTMLLoadOptions();
   private int r;
   private int s;
   private int t;
   private int u;
   private int v;
   private int w;
   private int x;
   private int y;
   private boolean z;
   private boolean A;
   private boolean B;
   private boolean C;
   private boolean D;
   private boolean E;
   private boolean F;
   private boolean G;
   private boolean H;
   private boolean I;
   private boolean J;
   private boolean K;
   private boolean L;
   private boolean M;
   private boolean N;
   private Style O;
   private HashMap P;
   private ICustomParser Q;
   private ICustomParser R;
   private String S;
   private zaew T;
   private boolean U;
   private String V = "";
   private IStreamProvider W;
   private com.aspose.cells.b.a.g.a.ze X = null;
   private static final com.aspose.cells.b.c.a.za Y = new com.aspose.cells.b.c.a.za(new String[]{"mso-xlrowspan", "mso-outline-level", "height", "display", "mso-ignore", "background", "mso-pattern", "white-space", "vertical-align", "text-align", "padding-right", "padding-left", "mso-char-indent-count", "font-size", "font-family", "font-weight", "color", "background-color", "width", "min-width", "mso-diagonal-down", "mso-diagonal-up", "border-top", "border-top-color", "border-left", "border-left-color", "border-right", "border-right-color", "border-bottom", "border-bottom-color", "border-bottom-style", "border-bottom-width", "border", "border-color", "text-decoration", "ltr", "rtl", "left", "right", "center", "justify", "middle", "top", "bottom", "margin", "font-style", "position", "z-index", "margin-left", "margin-top"});

   zaew a() {
      return this.T;
   }

   boolean b() {
      return this.U;
   }

   void a(boolean var1) {
      this.U = var1;
   }

   String c() {
      return this.V;
   }

   void a(String var1) {
      this.V = var1;
   }

   void a(IStreamProvider var1) {
      this.W = var1;
   }

   zaev(Workbook var1, zaew var2) {
      this.b = var1;
      this.c = var1.getWorksheets();
      this.r = -1;
      this.s = -1;
      this.t = 0;
      this.z = false;
      this.F = false;
      this.u = 0;
      this.v = 0;
      this.g = new HashMap();
      this.k = new ArrayList();
      this.m = new ArrayList();
      this.P = new HashMap();
      this.Q = this.b.getSettings().e().i();
      this.R = this.b.getSettings().e().h();
      this.S = "";
      this.T = var2;
   }

   void a(HashMap var1) {
      ++this.r;
      this.s = -1;
      if (var1 != null && var1.size() > 0) {
         this.v(var1);
      }

   }

   void b(HashMap var1) {
      ++this.r;
      this.s = 0;
      if (var1 != null && var1.size() > 0) {
         this.v(var1);
      }

   }

   void c(HashMap var1) {
      this.b(var1);
      if (this.T.i() > 0) {
         Cell var2 = this.d();
         if (var2 != null) {
            Style var3 = var2.getStyle();
            var3.setHorizontalAlignment(7);
            var3.setIndentLevel(this.T.i());
            var2.a(var3);
         }
      }

   }

   private void v(HashMap var1) {
      String var2 = (String)var1.get("height");
      if (var2 == null) {
         var2 = this.p;
      }

      int var3 = zaeu.a(var2);
      String var4 = (String)var1.get("style");
      if (var4 != null) {
         this.a(var4, var3);
      }

   }

   private void a(String var1, int var2) {
      boolean var3 = false;
      boolean var4 = false;
      zafa var5 = new zafa();
      var5.b(var1);
      ArrayList var6 = var5.e();
      Iterator var7 = var6.iterator();

      while(true) {
         while(var7.hasNext()) {
            zaeo var8 = (zaeo)var7.next();
            switch(Y.a(var8.a().toLowerCase())) {
            case 0:
               var3 = true;
               int var9 = com.aspose.cells.b.a.ze.f(var8.b());

               for(int var10 = 0; var10 < var9; ++var10) {
                  this.f.setRowHeightPixel(this.r + var10, var2 / var9);
               }

               this.r += var9 - 1;
            case 1:
            default:
               break;
            case 2:
               if (this.f == null) {
                  this.b.getWorksheets().get(0).getCells().setRowHeightPixel(this.r, var2);
               }
               break;
            case 3:
               if (var8.b().toLowerCase().equals("none")) {
                  var4 = true;
                  this.f.getRows().get(this.r).setHidden(true);
               }
            }
         }

         if (!var3 && this.f != null && !var4) {
            this.f.setRowHeightPixel(this.r, var2);
         }

         return;
      }
   }

   void d(HashMap var1) {
      if (this.f == null) {
         this.f = this.F().get(0).getCells();
      }

      ++this.s;
      int var2 = -1;
      Object var3 = var1.get("width");
      if (null != var3) {
         var2 = com.aspose.cells.b.a.ze.f((String)var3);
      }

      int var4 = -1;
      var3 = var1.get("mso-width");
      if (null != var3) {
         var4 = com.aspose.cells.b.a.ze.f((String)var3);
      }

      int var5 = 0;
      var3 = var1.get("span");
      if (null != var3) {
         var5 = com.aspose.cells.b.a.ze.f((String)var3);
      }

      if (var5 > 0) {
         this.s += var5 - 1;
      }

      if (var2 != -1) {
         int var6;
         if (var2 != 0 && var4 != 0) {
            if (var5 > 0) {
               for(var6 = 0; var6 < var5; ++var6) {
                  if (this.f != null) {
                     this.f.setColumnWidthPixel(this.t, var2);
                     ++this.t;
                  }
               }
            } else {
               this.f.getColumns().get(this.t).b(var2);
               ++this.t;
            }
         } else if (var5 > 0) {
            for(var6 = 0; var6 < var5; ++var6) {
               this.f.hideColumn(this.t);
               ++this.t;
            }
         } else {
            this.f.hideColumn(this.t);
            ++this.t;
         }
      }

   }

   void e(HashMap var1) throws Exception {
      this.z = true;
      ++this.s;
      if (this.k.size() > 0) {
         this.M();
      }

      Object var2 = var1.get("colspan");
      if (var2 != null) {
         this.v = com.aspose.cells.b.a.ze.f(this.e((String)var2));
      } else {
         this.v = 0;
      }

      var2 = var1.get("rowspan");
      if (var2 != null) {
         this.u = com.aspose.cells.b.a.ze.f(this.e((String)var2));
      } else {
         this.u = 0;
      }

      Cell var3 = this.d();
      if (var3 != null) {
         Object var4 = var1.get("class");
         if (var4 != null) {
            int var5 = 15;
            if (this.g != null && this.g.containsKey((String)var4)) {
               var5 = (Integer)this.g.get((String)var4);
            }

            this.i = this.F().B().a(var5);
         }

         if (this.i != null) {
            this.i.getFont().setBold(true);
            this.i.setVerticalAlignment(1);
            this.i.setHorizontalAlignment(1);
         }

         var3.a(this.i);
         var4 = var1.get("style");
         if (var4 != null) {
            Style var6 = var3.getStyle();
            if (!var6.getFont().isBold()) {
               var6.getFont().setBold(true);
            }

            if (var6.getVerticalAlignment() != 1) {
               var6.setVerticalAlignment(1);
            }

            if (var6.getHorizontalAlignment() != 1) {
               var6.setHorizontalAlignment(1);
            }

            this.a(com.aspose.cells.b.a.zr.a(var4).toLowerCase(), var6, var3);
         }

         this.K();
      }
   }

   private String e(String var1) {
      return var1.startsWith("'") && var1.endsWith("'") ? com.aspose.cells.b.a.zv.a(var1, "'", "") : var1;
   }

   void f(HashMap var1) throws Exception {
      this.z = true;
      ++this.s;
      if (this.k.size() > 0) {
         this.M();
      }

      Object var2 = var1.get("colspan");
      if (var2 != null) {
         this.v = com.aspose.cells.b.a.ze.f(this.e((String)var2));
      } else {
         this.v = 0;
      }

      var2 = var1.get("rowspan");
      if (var2 != null) {
         this.u = com.aspose.cells.b.a.ze.f(this.e((String)var2));
      } else {
         this.u = 0;
      }

      Object var3 = var1.get("class");
      if (var3 == null) {
         var3 = var1.get("CLASS");
      }

      int var4 = 15;
      if (var3 != null) {
         if (this.g != null && this.g.containsKey((String)var3)) {
            var4 = (Integer)this.g.get((String)var3);
         }
      } else if (this.g != null && this.g.containsKey("td")) {
         var4 = (Integer)this.g.get("td");
      }

      this.i = this.F().B().a(var4);
      if (this.i == null) {
         this.i = new Style();
      }

      Cell var5 = this.d();
      if (var5 != null) {
         if (this.j != null) {
            var5.a(this.j);
         }

         var5.b(var4);
         Object var6 = var1.get("width");
         var2 = var1.get("style");
         Style var7 = null;
         if (var2 != null) {
            String var8 = com.aspose.cells.b.a.zr.a(var2).toLowerCase();
            if (this.f(var8)) {
               var7 = this.a(var8, this.i, var5);
               if ((this.v != 0 || this.u != 0) && this.y == 1) {
                  int var9 = this.u == 0 ? 1 : this.u;
                  int var10 = this.v == 0 ? 1 : this.v;
                  Range var11 = new Range(this.r, this.s, var9, 1, this.f);
                  StyleFlag var12 = new StyleFlag();
                  var12.setAll(true);
                  var11.applyStyle(this.i, var12);
                  if (var10 > 1) {
                     if (var10 > 2) {
                        var11 = new Range(this.r, this.s + 1, var9, var10 - 2, this.f);
                     } else {
                        var11 = new Range(this.r, this.s + 1, var9, var10 - 1, this.f);
                     }

                     Style var13 = new Style(this.F());
                     var13.copy(this.i);
                     var13.getBorders().getByBorderType(1).setLineStyle(0);
                     var11.applyStyle(var13, var12);
                     if (var10 > 2 && var7 != null) {
                        var11 = new Range(this.r, this.s + var10 - 1, var9, 1, this.f);
                        var13.getBorders().getByBorderType(2).setLineStyle(var7.getBorders().getByBorderType(2).getLineStyle());
                        var13.getBorders().getByBorderType(2).setColor(var7.getBorders().getByBorderType(2).getColor());
                        var11.applyStyle(var13, var12);
                     }
                  }
               }
            }
         } else if (var6 != null && com.aspose.cells.b.a.zr.a(var6).indexOf("%") == -1) {
            int var14 = zaeu.a(com.aspose.cells.b.a.zr.a(var6));
            if (this.v <= 1) {
               this.f.setColumnWidthPixel(this.s, var14);
            }
         }

         if (var7 == null) {
            this.a(var3, this.i);
         } else {
            this.a(var3, var7);
         }

         Object var15 = var1.get("align");
         Object var16 = var1.get("valign");
         if (!"left".equals((String)var15) || !"top".equals((String)var16)) {
            Style var17;
            if (var15 != null) {
               var17 = var5.getStyle();
               var17.setHorizontalAlignment(this.h(com.aspose.cells.b.a.zr.a(var15)));
               var5.a(var17);
            }

            if (var16 != null) {
               var17 = var5.getStyle();
               var17.setVerticalAlignment(this.h(com.aspose.cells.b.a.zr.a(var16)));
               var5.a(var17);
            }
         }

         Object var18 = var1.get("dir");
         if (null != var18) {
            Style var19 = var5.getStyle();
            var19.setTextDirection(this.g(com.aspose.cells.b.a.zr.a(var18)));
            var5.a(var19);
         }

         this.a(var3, var5);
         if (this.q.getLoadFormulas()) {
            var2 = var1.get("x:fmla");
            this.a(var2, var5, var1);
         }

         var2 = var1.get("x:num");
         this.b(var2, var5);
         var2 = var1.get("x:bool");
         var2 = var1.get("x:str");
         var2 = var1.get("x:err");
      }
   }

   private boolean f(String var1) {
      String[] var2 = com.aspose.cells.b.a.zv.d(var1, new char[]{';'});
      if (var2.length > 2) {
         return true;
      } else {
         String[] var3 = null;

         for(int var4 = 0; var4 < var2.length; ++var4) {
            if (var2[var4].trim().length() > 2) {
               var3 = com.aspose.cells.b.a.zv.d(var2[var4], new char[]{':'});
               if (!var3[0].toLowerCase().equals("width") || !var3[0].toLowerCase().equals("height")) {
                  return true;
               }
            }
         }

         return false;
      }
   }

   void g(HashMap var1) {
      if (this.g != null) {
         Object var2 = var1.get("class");
         String var3 = (String)var2;
         if (var3 != null) {
            boolean var4 = true;
            if (this.g.containsKey(var3)) {
               int var5 = (Integer)this.g.get(var3);
               this.j = this.F().B().a(var5);
            }
         }

      }
   }

   private Style a(String var1, Style var2, Cell var3) throws Exception {
      Style var4 = new Style(this.c);
      if (var2 != null) {
         var4.copy(var2);
      }

      zafa var5 = new zafa();
      var5.b(var1);
      ArrayList var6 = var5.e();
      String var7 = null;
      String var8 = null;
      String var9 = null;
      String var10 = null;
      String var11 = null;
      Iterator var12 = var6.iterator();

      while(true) {
         while(var12.hasNext()) {
            zaeo var13 = (zaeo)var12.next();
            int var36;
            String var37;
            String var45;
            int var46;
            String var49;
            int var51;
            int var59;
            int var65;
            String var67;
            int var68;
            int var72;
            switch(Y.a(var13.a().toLowerCase())) {
            case 4:
               if (var13.b().equals("colspan")) {
                  this.y = 1;
               } else if (var13.b().equals("colspan-rowspan")) {
                  this.y = 2;
               } else {
                  this.y = 0;
               }
               break;
            case 5:
               if (!"auto".equals(var13.b())) {
                  var7 = var13.b();
               }
               break;
            case 6:
               var9 = var13.b();
            case 7:
            case 33:
            default:
               break;
            case 8:
               var4.setVerticalAlignment(zaff.f(var13.b().toLowerCase()));
               break;
            case 9:
               var4.setHorizontalAlignment(zaff.e(var13.b().toLowerCase()));
               if (var4.getHorizontalAlignment() != 7 && var4.getHorizontalAlignment() != 8) {
                  var4.setIndentLevel(0);
               }
               break;
            case 10:
               String var14 = var13.b().toLowerCase();
               int var15 = (new zaed(this.G())).a(var4, "0");
               int var16 = 0;
               if (!var14.endsWith("pt") && !var14.endsWith("px") && !var14.endsWith("in")) {
                  if (var14.endsWith("em")) {
                     var14 = var14.substring(0, 0 + (var14.length() - 2));
                     var16 = (int)((double)var15 * com.aspose.cells.b.a.zn.a(var14));
                  }
               } else {
                  var16 = zaeu.a(var14);
               }

               var4.setIndentLevel(var16 / var15 + (var16 % var15 == 0 ? 0 : 1));
               var4.setHorizontalAlignment(8);
               break;
            case 11:
               String var17 = var13.b().toLowerCase();
               int var18 = (new zaed(this.G())).a(var4, "0");
               int var19 = 0;
               if (!var17.endsWith("pt") && !var17.endsWith("px") && !var17.endsWith("in")) {
                  if (var17.endsWith("em")) {
                     var17 = var17.substring(0, 0 + (var17.length() - 2));
                     var19 = (int)((double)var18 * com.aspose.cells.b.a.zn.a(var17));
                  }
               } else {
                  var19 = zaeu.a(var17);
               }

               var4.setIndentLevel(var19 / var18 + (var19 % var18 == 0 ? 0 : 1));
               var4.setHorizontalAlignment(7);
               break;
            case 12:
               var4.setIndentLevel(zase.C(var13.b()));
               break;
            case 13:
               String var20 = var13.b().trim().toLowerCase();
               if (!var20.endsWith("pt") && !var20.endsWith("px") && !var20.endsWith("in")) {
                  if (var20.endsWith("%")) {
                     var20 = var20.substring(0, 0 + (var20.length() - 1));
                     var4.getFont().setDoubleSize(var4.getFont().getDoubleSize() * (com.aspose.cells.b.a.zn.a(var20) / 100.0D));
                  } else if (var20.endsWith("em")) {
                     var20 = var20.substring(0, 0 + (var20.length() - 2));
                     var4.getFont().setDoubleSize(var4.getFont().getDoubleSize() * com.aspose.cells.b.a.zn.a(var20));
                  } else if (zaeu.d(var20)) {
                     var4.getFont().setDoubleSize(var4.getFont().getDoubleSize() * zaeu.e(var20));
                  } else {
                     var4.getFont().setDoubleSize(zaeu.b(var20));
                  }
                  break;
               }

               var4.getFont().setDoubleSize(zaeu.b(var20));
               break;
            case 14:
               zaeu.a(var13.b(), var4.getFont());
               break;
            case 15:
               if ("bold".equals(var13.b().toLowerCase())) {
                  var4.getFont().setBold(true);
               } else if ("normal".equals(var13.b().toLowerCase())) {
                  var4.getFont().b(400);
               } else {
                  var4.getFont().b(zaeu.c(var13.b()));
               }
               break;
            case 16:
               var4.getFont().setColor(zaer.g(var13.b()));
               break;
            case 17:
               if (!"auto".equals(var13.b())) {
                  var8 = var13.b();
               }
               break;
            case 18:
            case 19:
               if (var13.b().indexOf("%") == -1) {
                  int var40 = zaeu.a(var13.b());
                  Object var41 = this.P.get(this.s);
                  if (this.v <= 1) {
                     if (var41 == null) {
                        this.P.put(this.s, var40);
                     } else if ((Integer)var41 < var40) {
                        this.P.put(this.s, var40);
                     }
                  }
               }
               break;
            case 20:
               String[] var21 = com.aspose.cells.b.a.zv.d(var13.b(), ' ');
               Border var22 = var4.getBorders().getByBorderType(16);
               int var43;
               String var44;
               if (var21.length > 3 && var13.b().toLowerCase().indexOf("rgb") != -1) {
                  var43 = zaeq.a(var21[0] + " " + var21[1]);
                  var22.setLineStyle(var43);
                  var44 = "";

                  for(var46 = 2; var46 < var21.length; ++var46) {
                     var44 = var44 + var21[var46];
                  }

                  Color var50;
                  if ("windowtext".equals(var44)) {
                     var50 = zaer.g(this.o);
                     var22.setColor(var50);
                  } else {
                     var50 = zaer.g(var44);
                     var22.setColor(var50);
                  }
               } else if (var21.length == 3) {
                  String var42 = var21[0];
                  var44 = var21[1];
                  var45 = var21[2];
                  var22.setColor(zaer.g(var45));
                  int var48 = zaeq.a(var42 + " " + var44);
                  var22.setLineStyle(var48);
               } else if (var21.length == 2) {
                  var43 = zaeq.a(var13.b());
                  var22.setLineStyle(var43);
               } else {
                  var22.setLineStyle(0);
               }
               break;
            case 21:
               String[] var23 = com.aspose.cells.b.a.zv.d(var13.b(), ' ');
               Border var24 = var4.getBorders().getByBorderType(32);
               String var47;
               if (var23.length > 3 && var13.b().toLowerCase().indexOf("rgb") != -1) {
                  var46 = zaeq.a(var23[0] + " " + var23[1]);
                  var24.setLineStyle(var46);
                  var47 = "";

                  for(var51 = 2; var51 < var23.length; ++var51) {
                     var47 = var47 + var23[var51];
                  }

                  Color var55;
                  if ("windowtext".equals(var47)) {
                     var55 = zaer.g(this.o);
                     var24.setColor(var55);
                  } else {
                     var55 = zaer.g(var47);
                     var24.setColor(var55);
                  }
               } else if (var23.length == 3) {
                  var45 = var23[0];
                  var47 = var23[1];
                  var49 = var23[2];
                  var24.setColor(zaer.g(var49));
                  int var53 = zaeq.a(var45 + " " + var47);
                  var24.setLineStyle(var53);
               } else if (var23.length == 2) {
                  var46 = zaeq.a(var13.b());
                  var24.setLineStyle(var46);
               } else {
                  var24.setLineStyle(0);
               }
               break;
            case 22:
               String[] var25 = com.aspose.cells.b.a.zv.d(var13.b(), ' ');
               Border var26 = var4.getBorders().getByBorderType(4);
               String var52;
               if (var25.length > 3 && var13.b().toLowerCase().indexOf("rgb") != -1) {
                  var51 = zaeq.a(var25[0] + " " + var25[1]);
                  var26.setLineStyle(var51);
                  var52 = "";

                  for(int var56 = 2; var56 < var25.length; ++var56) {
                     var52 = var52 + var25[var56];
                  }

                  Color var58;
                  if ("windowtext".equals(var52)) {
                     var58 = zaer.g(this.o);
                     var26.setColor(var58);
                  } else {
                     var58 = zaer.g(var52);
                     var26.setColor(var58);
                  }
               } else if (var25.length == 3) {
                  var49 = var25[0];
                  var52 = var25[1];
                  String var54 = var25[2];
                  var26.setColor(zaer.g(var54));
                  var59 = zaeq.a(var49 + " " + var52);
                  var26.setLineStyle(var59);
               } else if (var25.length == 2) {
                  var51 = zaeq.a(var13.b());
                  var26.setLineStyle(var51);
               } else {
                  var26.setLineStyle(0);
               }
               break;
            case 23:
               Border var27 = var4.getBorders().getByBorderType(4);
               var27.setColor(zaer.g(var13.b()));
               break;
            case 24:
               String[] var28 = com.aspose.cells.b.a.zv.d(var13.b(), ' ');
               Border var29 = var4.getBorders().getByBorderType(1);
               String var60;
               if (var28.length > 3 && var13.b().toLowerCase().indexOf("rgb") != -1) {
                  var59 = zaeq.a(var28[0] + " " + var28[1]);
                  var29.setLineStyle(var59);
                  var60 = "";

                  for(int var62 = 2; var62 < var28.length; ++var62) {
                     var60 = var60 + var28[var62];
                  }

                  Color var64;
                  if ("windowtext".equals(var60)) {
                     var64 = zaer.g(this.o);
                     var29.setColor(var64);
                  } else {
                     var64 = zaer.g(var60);
                     var29.setColor(var64);
                  }
               } else if (var28.length == 3) {
                  String var57 = var28[0];
                  var60 = var28[1];
                  String var61 = var28[2];
                  var29.setColor(zaer.g(var61));
                  var65 = zaeq.a(var57 + " " + var60);
                  var29.setLineStyle(var65);
               } else if (var28.length == 2) {
                  var59 = zaeq.a(var13.b());
                  var29.setLineStyle(var59);
               } else {
                  var29.setLineStyle(0);
               }
               break;
            case 25:
               Border var30 = var4.getBorders().getByBorderType(1);
               var30.setColor(zaer.g(var13.b()));
               break;
            case 26:
               String[] var31 = com.aspose.cells.b.a.zv.d(var13.b(), ' ');
               Border var32 = var4.getBorders().getByBorderType(2);
               String var66;
               if (var31.length > 3 && var13.b().toLowerCase().indexOf("rgb") != -1) {
                  var65 = zaeq.a(var31[0] + " " + var31[1]);
                  var32.setLineStyle(var65);
                  var66 = "";

                  for(var68 = 2; var68 < var31.length; ++var68) {
                     var66 = var66 + var31[var68];
                  }

                  Color var70;
                  if ("windowtext".equals(var66)) {
                     var70 = zaer.g(this.o);
                     var32.setColor(var70);
                  } else {
                     var70 = zaer.g(var66);
                     var32.setColor(var70);
                  }
               } else if (var31.length == 3) {
                  String var63 = var31[0];
                  var66 = var31[1];
                  var67 = var31[2];
                  var32.setColor(zaer.g(var67));
                  var36 = zaeq.a(var63 + " " + var66);
                  var32.setLineStyle(var36);
               } else if (var31.length == 2) {
                  var65 = zaeq.a(var13.b());
                  var32.setLineStyle(var65);
               } else {
                  var32.setLineStyle(0);
               }
               break;
            case 27:
               var4.getBorders().getByBorderType(2).setColor(zaer.g(var13.b()));
               break;
            case 28:
               String[] var33 = com.aspose.cells.b.a.zv.d(var13.b(), ' ');
               Border var34 = var4.getBorders().getByBorderType(8);
               String var69;
               if (var33.length > 3 && var13.b().toLowerCase().indexOf("rgb") != -1) {
                  var68 = zaeq.a(var33[0] + " " + var33[1]);
                  var34.setLineStyle(var68);
                  var69 = "";

                  for(int var71 = 2; var71 < var33.length; ++var71) {
                     var69 = var69 + var33[var71];
                  }

                  Color var73;
                  if ("windowtext".equals(var69)) {
                     var73 = zaer.g(this.o);
                     var34.setColor(var73);
                  } else {
                     var73 = zaer.g(var69);
                     var34.setColor(var73);
                  }
               } else if (var33.length == 3) {
                  var67 = var33[0];
                  var69 = var33[1];
                  var37 = var33[2];
                  var34.setColor(zaer.g(var37));
                  var72 = zaeq.a(var67 + " " + var69);
                  var34.setLineStyle(var72);
               } else if (var33.length == 2) {
                  var68 = zaeq.a(var13.b());
                  var34.setLineStyle(var68);
               } else {
                  var34.setLineStyle(0);
               }
               break;
            case 29:
               var4.getBorders().getByBorderType(8).setColor(zaer.g(var13.b()));
               break;
            case 30:
               var10 = var13.b();
               break;
            case 31:
               var11 = var13.b();
               break;
            case 32:
               String[] var35 = com.aspose.cells.b.a.zv.d(var13.b(), ' ');
               Color var38;
               if (var35.length > 3 && var13.b().toLowerCase().indexOf("rgb") != -1) {
                  var36 = zaeq.a(var35[0] + " " + var35[1]);
                  var4.getBorders().getByBorderType(8).setLineStyle(var36);
                  var4.getBorders().getByBorderType(4).setLineStyle(var36);
                  var4.getBorders().getByBorderType(1).setLineStyle(var36);
                  var4.getBorders().getByBorderType(2).setLineStyle(var36);
                  var37 = "";

                  for(var72 = 2; var72 < var35.length; ++var72) {
                     var37 = var37 + var35[var72];
                  }

                  if ("windowtext".equals(var37)) {
                     var38 = zaer.g(this.o);
                     var4.getBorders().getByBorderType(8).setColor(var38);
                     var4.getBorders().getByBorderType(4).setColor(var38);
                     var4.getBorders().getByBorderType(1).setColor(var38);
                     var4.getBorders().getByBorderType(2).setColor(var38);
                  } else {
                     var38 = zaer.g(var37);
                     var4.getBorders().getByBorderType(8).setColor(var38);
                     var4.getBorders().getByBorderType(4).setColor(var38);
                     var4.getBorders().getByBorderType(1).setColor(var38);
                     var4.getBorders().getByBorderType(2).setColor(var38);
                  }
               } else if (var35.length == 3) {
                  var36 = zaeq.a(var35[0] + " " + var35[1]);
                  var4.getBorders().getByBorderType(8).setLineStyle(var36);
                  var4.getBorders().getByBorderType(4).setLineStyle(var36);
                  var4.getBorders().getByBorderType(1).setLineStyle(var36);
                  var4.getBorders().getByBorderType(2).setLineStyle(var36);
                  var37 = var35[2];
                  if ("windowtext".equals(var37)) {
                     var38 = zaer.g(this.o);
                     var4.getBorders().getByBorderType(8).setColor(var38);
                     var4.getBorders().getByBorderType(4).setColor(var38);
                     var4.getBorders().getByBorderType(1).setColor(var38);
                     var4.getBorders().getByBorderType(2).setColor(var38);
                  } else {
                     var38 = zaer.g(var37);
                     var4.getBorders().getByBorderType(8).setColor(var38);
                     var4.getBorders().getByBorderType(4).setColor(var38);
                     var4.getBorders().getByBorderType(1).setColor(var38);
                     var4.getBorders().getByBorderType(2).setColor(var38);
                  }
               } else if (var35.length == 2) {
                  var36 = zaeq.a(var13.b());
                  var4.getBorders().getByBorderType(8).setLineStyle(var36);
                  var4.getBorders().getByBorderType(4).setLineStyle(var36);
                  var4.getBorders().getByBorderType(1).setLineStyle(var36);
                  var4.getBorders().getByBorderType(2).setLineStyle(var36);
               } else {
                  var4.getBorders().getByBorderType(8).setLineStyle(0);
                  var4.getBorders().getByBorderType(4).setLineStyle(0);
                  var4.getBorders().getByBorderType(1).setLineStyle(0);
                  var4.getBorders().getByBorderType(2).setLineStyle(0);
               }
               break;
            case 34:
               if ("underline".equals(var13.b().trim())) {
                  var4.getFont().setUnderline(zaer.f(var13.b()));
               } else if ("line-through".equals(var13.b().trim())) {
                  var4.getFont().setStrikeout(true);
               }
            }
         }

         if (var10 != null && var11 != null) {
            var4.getBorders().getByBorderType(8).setLineStyle(zaeq.a(var11 + " " + var10));
         }

         if ((var7 != null || var8 != null) && var9 == null) {
            var4.setPattern(1);
            var4.setForegroundColor(zaer.g(var7 == null ? var8 : var7));
         }

         if (var7 == null && var8 == null && var9 != null) {
            zaer.a(var9, var4);
         }

         if ((var7 != null || var8 != null) && var9 != null) {
            Color var39 = zaer.g(var7 == null ? var8 : var7);
            zaer.a(var9, var4, var39);
         }

         var3.a(var4);
         return var4;
      }
   }

   private int g(String var1) {
      switch(Y.a(var1.toLowerCase())) {
      case 35:
         return 1;
      case 36:
         return 2;
      default:
         return 0;
      }
   }

   private int h(String var1) {
      switch(Y.a(var1.toLowerCase())) {
      case 37:
         return 7;
      case 38:
         return 8;
      case 39:
         return 1;
      case 40:
         return 6;
      case 41:
         return 1;
      case 42:
         return 9;
      case 43:
         return 0;
      default:
         return 8;
      }
   }

   Cell d() {
      if (this.f == null) {
         this.f = this.F().get(0).getCells();
      }

      return this.f != null && this.r != -1 && this.s != -1 ? this.f.get(this.r, this.s) : null;
   }

   private void a(Object var1, Style var2) {
      if (this.y == 0 && (this.u > 1 || this.v > 1)) {
         if (var1 != null) {
            StyleFlag var3 = new StyleFlag();
            var3.setAll(true);
            Range var4;
            if (this.u == 0) {
               var4 = this.f.createRange(this.r, this.s, 1, this.v);
               var4.applyStyle(var2, var3);
            } else if (this.v == 0) {
               var4 = this.f.createRange(this.r, this.s, this.u, 1);
               var4.applyStyle(var2, var3);
            } else {
               var4 = this.f.createRange(this.r, this.s, this.u, this.v);
               var4.applyStyle(var2, var3);
            }
         }

         CellArea var5;
         CellArea[] var6;
         if (this.v == 0) {
            if (this.y == 0 && !this.f.q().c(this.r, this.s)) {
               this.f.merge(this.r, this.s, this.u, 1);
            }

            var5 = new CellArea();
            var6 = new CellArea[]{var5};
            this.a(this.r, this.s, this.r + this.u - 1, this.s, var6);
            var5 = var6[0];
            com.aspose.cells.b.a.a.ze.a(this.k, (Object)var5);
         } else if (this.u == 0) {
            if (this.y == 0 && !this.f.q().c(this.r, this.s)) {
               this.f.merge(this.r, this.s, 1, this.v);
            }

            var5 = new CellArea();
            var6 = new CellArea[]{var5};
            this.a(this.r, this.s, this.r, this.s + this.v - 1, var6);
            var5 = var6[0];
            com.aspose.cells.b.a.a.ze.a(this.k, (Object)var5);
         } else {
            if (this.y == 0 && !this.f.q().c(this.r, this.s)) {
               this.f.merge(this.r, this.s, this.u, this.v);
            }

            var5 = new CellArea();
            var6 = new CellArea[]{var5};
            this.a(this.r, this.s, this.r + this.u - 1, this.s + this.v - 1, var6);
            var5 = var6[0];
            com.aspose.cells.b.a.a.ze.a(this.k, (Object)var5);
         }
      }

   }

   private void K() {
      if (this.y == 0 && (this.u > 1 || this.v > 1)) {
         CellArea var1;
         CellArea[] var2;
         if (this.v == 0) {
            if (this.y == 0 && !this.f.q().c(this.r, this.s)) {
               this.f.merge(this.r, this.s, this.u, 1);
            }

            var1 = new CellArea();
            var2 = new CellArea[]{var1};
            this.a(this.r, this.s, this.r + this.u - 1, this.s, var2);
            var1 = var2[0];
            com.aspose.cells.b.a.a.ze.a(this.k, (Object)var1);
         } else if (this.u == 0) {
            if (this.y == 0 && !this.f.q().c(this.r, this.s)) {
               this.f.merge(this.r, this.s, 1, this.v);
            }

            var1 = new CellArea();
            var2 = new CellArea[]{var1};
            this.a(this.r, this.s, this.r, this.s + this.v - 1, var2);
            var1 = var2[0];
            com.aspose.cells.b.a.a.ze.a(this.k, (Object)var1);
         } else {
            if (this.y == 0 && !this.f.q().c(this.r, this.s)) {
               this.f.merge(this.r, this.s, this.u, this.v);
            }

            var1 = new CellArea();
            var2 = new CellArea[]{var1};
            this.a(this.r, this.s, this.r + this.u - 1, this.s + this.v - 1, var2);
            var1 = var2[0];
            com.aspose.cells.b.a.a.ze.a(this.k, (Object)var1);
         }
      }

   }

   void h(HashMap var1) {
   }

   void e() {
   }

   void i(HashMap var1) {
      Object var2 = var1.get("colspan");
      Object var3 = var1.get("rowspan");
      if (var2 != null) {
         this.x = com.aspose.cells.b.a.zo.a((String)var2) - 1;
      }

      if (var3 != null) {
         this.w = com.aspose.cells.b.a.zo.a((String)var3);
      }

      this.w(var1);
   }

   private void w(HashMap var1) {
      Object var2 = var1.get("class");
      if (var2 == null) {
         var2 = var1.get("CLASS");
      }

      int var3 = 15;
      if (var2 != null) {
         if (this.g != null && this.g.containsKey((String)var2)) {
            var3 = (Integer)this.g.get((String)var2);
         }
      } else if (this.g != null && this.g.containsKey("td")) {
         var3 = (Integer)this.g.get("td");
      }

      this.i = this.F().B().a(var3);
      if (this.i == null) {
         this.i = new Style();
      }

      Cell var4 = this.d();
      if (var4 != null) {
         BorderCollection var5 = var4.getStyle().getBorders();
         if (this.j != null) {
            var4.a(this.j);
         }

         if (var3 != 15) {
            var4.b(var3);
         }

         Style var6 = var4.getStyle();
         var6.getBorders().a(var5);
         var4.a(var6);
         Object var7 = var1.get("align");
         if (var7 != null) {
            Style var8 = var4.getStyle();
            var8.setHorizontalAlignment(this.h(com.aspose.cells.b.a.zr.a(var7)));
            var4.a(var8);
         }

         Object var10 = var1.get("valign");
         if (var10 != null) {
            Style var9 = var4.getStyle();
            var9.setVerticalAlignment(this.h(com.aspose.cells.b.a.zr.a(var10)));
            var4.a(var9);
         }

         Object var11;
         if (this.q.getLoadFormulas()) {
            var11 = var1.get("x:fmla");
            this.a(var11, var4, var1);
         }

         var11 = var1.get("x:num");
         this.b(var11, var4);
      }
   }

   void f() {
      this.x = 0;
      this.w = 0;
   }

   void j(HashMap var1) {
      if (null == this.d) {
         this.d = this.G().getWorksheets().get(0);
      }

      if (var1.get("href") != null) {
         this.a(this.b((String)var1.get("href")));
      }

      if (!this.M) {
         if (var1.get("href") != null && this.r > -1 && this.s > -1) {
            this.d.getHyperlinks().add(this.r, this.s, 1, 1, this.b((String)var1.get("href")));
            this.C = true;
         }

         if (var1.get("name") != null && this.r > -1 && this.s > -1 && this.T.h()) {
            int var2 = this.c.getNames().add((String)var1.get("name"));
            Name var3 = this.c.getNames().get(var2);
            CellArea var4 = new CellArea();
            var4.StartColumn = this.s;
            var4.EndColumn = this.s;
            var4.StartRow = this.r;
            var4.EndRow = this.r;
            var3.a(this.d.getIndex(), var4);
         }

      }
   }

   void b(boolean var1) {
      this.M = var1;
   }

   String b(String var1) {
      if (!"../#".equals(var1) && !"#".equals(var1)) {
         if (var1.indexOf("&#") > 0) {
            var1 = com.aspose.cells.b.a.zv.a(com.aspose.cells.b.a.zv.a(com.aspose.cells.b.a.zv.a(com.aspose.cells.b.a.zv.a(var1, "&#47;", "/"), "&#58;", ":"), "&#61;", "="), "&#63;", "?");
         }

         if (var1.indexOf("#") > -1) {
            String[] var2;
            if (!var1.startsWith("#") && !var1.startsWith("null#")) {
               var2 = com.aspose.cells.b.a.zv.d(var1, '#');
               if (var2.length < 2) {
                  return var1;
               } else if (zafd.a.get(var2[1]) != null && !"".equals((String)zafd.a.get(var2[1]))) {
                  return (String)zafd.a.get(var2[1]);
               } else if (var1.indexOf("!") == -1 && var2[1].indexOf("!") == -1) {
                  return "#" + var2[1];
               } else {
                  String[] var3 = com.aspose.cells.b.a.zv.d(var2[0], '.');
                  String[] var4 = com.aspose.cells.b.a.zv.d(var3[0], 't');
                  if (var4.length < 2) {
                     return var1;
                  } else {
                     String[] var5 = com.aspose.cells.b.a.zv.d(var2[1], '!');
                     if (var5.length < 2) {
                        return var1;
                     } else {
                        int var6 = com.aspose.cells.b.a.zo.a(var4[1]) - 1;
                        return "'" + this.c.get(var6).getName() + "'!" + var5[1];
                     }
                  }
               }
            } else {
               var2 = com.aspose.cells.b.a.zv.d(var1, '!');
               if (var2.length < 2) {
                  return var1;
               } else {
                  return "#RANGE".equals(var2[0]) ? "#" + var2[1] : var2[1];
               }
            }
         } else if (var1.indexOf("../") > -1) {
            return var1.substring(3);
         } else {
            return !var1.startsWith("http://") && !var1.startsWith("www.") ? var1 + "!A1" : var1;
         }
      } else {
         return var1;
      }
   }

   void k(HashMap var1) throws Exception {
      if (this.r < 0) {
         this.r = 0;
      }

      if (this.s < 0) {
         this.s = 0;
      }

      String var2 = (String)var1.get("v:shapes");
      String var3 = (String)var1.get("src");
      if (var3.startsWith("file:///") && var3.indexOf("\\") > -1) {
         var3 = com.aspose.cells.b.a.zv.a(var3, "\\", "/");
      }

      int var7;
      int var13;
      int var37;
      int var40;
      if (var2 == null) {
         zaex var25 = (zaex)this.h.get("SavedByAspose");
         int var27;
         if (var25 != null) {
            boolean var26 = true;
            if (var25.b() == null) {
               com.aspose.cells.b.a.d.zh var28 = null;
               if (this.j(var3)) {
                  byte[] var32 = com.aspose.cells.b.a.ze.b(var3.substring(var3.indexOf(44) + 1));
                  var28 = new com.aspose.cells.b.a.d.zh(var32);
                  var27 = this.d.getPictures().a(this.r, this.s, var28);
               } else {
                  StreamProviderOptions var34 = new StreamProviderOptions();
                  var34.a = var3;
                  var34.b = var25.d() + var3;
                  this.W.initStream(var34);
                  com.aspose.cells.b.a.d.zm var29 = var34.c;
                  var27 = this.d.getPictures().a(this.r, this.s, var29);
               }
            } else {
               var27 = this.d.getPictures().a(this.r, this.s, var25.b());
            }

            Picture var30 = this.d.getPictures().get(var27);
            var7 = var25.g();
            int var35 = var25.h();
            int var36 = var25.f();
            var37 = var25.e();
            Cells var39 = this.E().getCells();
            var40 = this.s;

            for(var13 = var39.getColumnWidthPixel(var40); var37 > var13; var13 = var39.getColumnWidthPixel(var40)) {
               ++var40;
               var37 -= var13;
            }

            var30.a(this.r, var36, var40, var37, var35, var7);
            if (this.b() && !"".equals(this.c())) {
               var30.addHyperlink(this.c());
               this.a("");
            }

            this.h.remove("SavedByAspose");
         } else {
            if (this.d == null) {
               this.a(this.c.get(0));
            }

            if (var3.startsWith("http")) {
               try {
                  this.i(var3);
               } catch (Exception var22) {
                  ;
               }
            } else if (com.aspose.cells.b.a.d.zk.f(var3)) {
               if (!com.aspose.cells.b.a.d.zd.c(var3)) {
                  return;
               }

               var27 = this.d.getPictures().add(this.r, this.s, var3);
               if (this.b() && !"".equals(this.c())) {
                  this.d.getPictures().get(var27).addHyperlink(this.c());
                  this.a("");
               }
            } else {
               String var31 = this.q.getAttachedFilesDirectory();
               if (var31 != null) {
                  com.aspose.cells.b.a.zv.a(var31, "\\", "/");
               }

               if (var31 != null && !var31.endsWith("/") && !var31.endsWith("\\")) {
                  var31 = var31 + "/";
               }

               if (var31 == null) {
                  var31 = "";
               }

               String var33 = var31 + var3;
               if (com.aspose.cells.b.a.d.zd.c(var33)) {
                  var7 = this.d.getPictures().add(this.r, this.s, var31 + var3);
                  if (this.b() && !"".equals(this.c())) {
                     this.d.getPictures().get(var7).addHyperlink(this.c());
                     this.a("");
                  }
               } else {
                  try {
                     this.i(var33);
                  } catch (Exception var21) {
                     ;
                  }
               }
            }
         }
      } else {
         String[] var4 = com.aspose.cells.b.a.zv.d(var2, ' ');
         String[] var5 = var4;
         int var6 = var4.length;

         for(var7 = 0; var7 < var6; ++var7) {
            String var8 = var5[var7];
            zaex var9 = null;

            try {
               var9 = (zaex)this.h.get(var8);
               if (var9 != null) {
                  boolean var10 = true;
                  if (var9.b() == null) {
                     StreamProviderOptions var11 = new StreamProviderOptions();
                     var11.a = var3;
                     var11.b = var9.d() + var3;
                     this.W.initStream(var11);
                     com.aspose.cells.b.a.d.zm var12 = var11.c;
                     if (null == var12) {
                        return;
                     }

                     var37 = this.d.getPictures().a(this.r, this.s, var12);
                  } else {
                     var37 = this.d.getPictures().a(this.r, this.s, var9.b());
                  }

                  Picture var38 = this.d.getPictures().get(var37);
                  var40 = var9.g();
                  var13 = var9.h();
                  int var14 = var9.f();
                  int var15 = var9.e();
                  var38.a(this.r, var14, this.s, var15, var13, var40);
                  var38.setPrintable(var9.k());
                  var38.setLocked(var9.j());
                  if (this.b() && !"".equals(this.c())) {
                     var38.addHyperlink(this.c());
                     this.a("");
                  }
               }
            } catch (Exception var23) {
               ;
            } finally {
               if (var9 != null && var9.b() != null) {
                  var9.b().a();
               }

            }
         }
      }

   }

   private void i(String var1) throws Exception {
      int var2 = -1;
      if (this.j(var1)) {
         byte[] var3 = com.aspose.cells.b.a.ze.b(var1.substring(var1.indexOf(44) + 1));
         com.aspose.cells.b.a.d.zh var4 = new com.aspose.cells.b.a.d.zh(var3);
         var2 = this.d.getPictures().a(this.r, this.s, var4);
      }

      if (this.k(var1)) {
         com.aspose.cells.b.a.d.zm var5 = com.aspose.cells.a.c.zv.d(var1);
         if (var5 != null) {
            var2 = this.d.getPictures().a(this.r, this.s, var5);
         }
      }

      if (-1 != var2 && this.b() && !"".equals(this.c())) {
         this.d.getPictures().get(var2).addHyperlink(this.c());
         this.a("");
      }

   }

   private boolean j(String var1) {
      return var1.startsWith("data:image") && var1.indexOf("base64") > -1;
   }

   private boolean k(String var1) {
      return var1.startsWith("http") || var1.startsWith("file://") || var1.startsWith("ftp://");
   }

   void l(HashMap var1) {
      this.K = true;
      this.L = true;
   }

   void m(HashMap var1) throws Exception {
      Object var2 = var1.get("style");
      if (var2 != null) {
         Cell var3 = this.d();
         if (var3 != null) {
            Style var4 = new Style(this.c);
            if (var3.getStyle() != null) {
               var4.copy(var3.getStyle());
            }

            this.a(com.aspose.cells.b.a.zr.a(var2).toLowerCase(), var4, var3);
         }
      }
   }

   void n(HashMap var1) {
      Object var2 = var1.get("style");
      if (var2 != null) {
         Cell var3 = this.d();
         if (var3 != null) {
            Style var4 = new Style(this.c);
            if (var3.getStyle() != null) {
               var4.copy(var3.getStyle());
            }

            zafa var5 = new zafa();
            var5.b((String)var2);
            ArrayList var6 = var5.e();
            Iterator var7 = var6.iterator();

            while(var7.hasNext()) {
               zaeo var8 = (zaeo)var7.next();
               switch(Y.a(var8.a().toLowerCase())) {
               case 44:
                  String[] var9 = com.aspose.cells.b.a.zv.d(var8.b(), ' ');
                  if (var9.length == 4 && "18pt".equals(var9[3])) {
                     var4.setIndentLevel(1);
                  }
               }
            }

            var3.a(var4);
         }
      }
   }

   void o(HashMap var1) throws Exception {
      Object var2 = var1.get("style");
      if (var2 != null) {
         Cell var3 = this.d();
         if (var3 != null) {
            Style var4 = new Style(this.c);
            if (var3.getStyle() != null) {
               var4.copy(var3.getStyle());
            }

            this.a(com.aspose.cells.b.a.zr.a(var2).toLowerCase(), var4, var3);
         }
      }
   }

   void p(HashMap var1) {
      this.N = true;
      this.s = 0;
      Object var2 = var1.get("style");
      if (var2 != null) {
         this.O = new Style(this.c);
         if (this.i != null) {
            this.O.copy(this.i);
         }

         zafa var3 = new zafa();
         var3.b((String)var2);
         ArrayList var4 = var3.e();
         Iterator var5 = var4.iterator();

         while(true) {
            while(var5.hasNext()) {
               zaeo var6 = (zaeo)var5.next();
               switch(Y.a(var6.a().toLowerCase())) {
               case 8:
                  if ("super".equals(var6.b())) {
                     this.O.getFont().setSuperscript(true);
                  }

                  if ("sub".equals(var6.b())) {
                     this.O.getFont().setSubscript(true);
                  }
                  break;
               case 13:
                  String var7 = var6.b().trim().toLowerCase();
                  if (!var7.endsWith("pt") && !var7.endsWith("px") && !var7.endsWith("in")) {
                     if (var7.endsWith("%")) {
                        var7 = var7.substring(0, 0 + (var7.length() - 1));
                        this.O.getFont().setDoubleSize(this.O.getFont().getDoubleSize() * (com.aspose.cells.b.a.zn.a(var7) / 100.0D));
                     } else if (var7.endsWith("em")) {
                        var7 = var7.substring(0, 0 + (var7.length() - 2));
                        this.O.getFont().setDoubleSize(this.O.getFont().getDoubleSize() * com.aspose.cells.b.a.zn.a(var7));
                     } else if (zaeu.d(var7)) {
                        this.O.getFont().setDoubleSize(this.O.getFont().getDoubleSize() * zaeu.e(var7));
                     } else {
                        this.O.getFont().setDoubleSize(zaeu.b(var7));
                     }
                     break;
                  }

                  this.O.getFont().setDoubleSize(zaeu.b(var7));
                  break;
               case 14:
                  zaeu.a(var6.b(), this.O.getFont());
                  break;
               case 15:
                  if ("bold".equals(var6.b().toLowerCase())) {
                     this.O.getFont().setBold(true);
                  }
                  break;
               case 16:
                  this.O.getFont().setColor(zaer.g(var6.b()));
                  break;
               case 34:
                  if ("underline".equals(var6.b().trim())) {
                     this.O.getFont().setUnderline(zaer.f(var6.b()));
                  } else if ("line-through".equals(var6.b().trim())) {
                     this.O.getFont().setStrikeout(true);
                  }
               case 45:
               }
            }

            return;
         }
      }
   }

   void q(HashMap var1) {
      this.N = true;
      Object var2 = var1.get("style");
      if (var2 != null) {
         this.O = new Style(this.c);
         if (this.i != null) {
            this.O.copy(this.i);
         }

      }
   }

   void a(HashMap var1, String var2) {
      String var3 = (String)var1.get("style");
      if (var3.indexOf("z-index") > -1 && this.h.size() == 0) {
         String[] var4 = com.aspose.cells.b.a.zv.d(var3, ';');
         zaex var5 = new zaex();
         var5.a("SavedByAspose");
         var5.c(var2);

         for(int var6 = 0; var6 < var4.length; ++var6) {
            String[] var7 = com.aspose.cells.b.a.zv.d(var4[var6], ':');
            String var8 = var7[0].trim();
            String var9 = var7[1].trim();
            switch(Y.a(var8.toLowerCase())) {
            case 2:
               var5.d(zaeu.a(var9));
            case 4:
            case 46:
            case 47:
            default:
               break;
            case 18:
               var5.c(zaeu.a(var9));
               break;
            case 48:
               var5.a(zaeu.a(var9));
               break;
            case 49:
               var5.b(zaeu.a(var9));
            }
         }

         this.h.put(var5.a(), var5);
      }

   }

   void g() {
      this.K = false;
      this.N = false;
   }

   void a(int var1) {
      if (this.d != null) {
         Picture var2 = new Picture(this.d.getShapes());
         int[] var3 = var2.b(this.s, 0, var1);
         this.s = var3[0];
      }
   }

   void h() {
      this.A = true;
   }

   void i() {
      this.A = false;
   }

   void j() {
      this.B = true;
   }

   void k() {
      this.B = false;
   }

   void l() {
      this.S = this.S + "\r\n";
   }

   private String l(String var1) {
      int var2;
      StringBuilder var3;
      char var6;
      if (var1.length() > 0 && "".equals(var1.trim())) {
         var2 = var1.length();
         var3 = new StringBuilder();
         StringBuilder var4 = new StringBuilder();

         for(int var5 = 0; var5 < var2; ++var5) {
            var6 = var1.charAt(var5);
            if (var6 == ' ') {
               var4.append(var6);
            } else {
               var3.append(var6);
            }
         }

         if (var4.length() > 1) {
            var3.append(" ");
         }
      }

      if (var1.indexOf(13) <= -1) {
         return var1;
      } else {
         var2 = var1.length();
         var3 = new StringBuilder();

         for(int var8 = 0; var8 < var2; ++var8) {
            char var9 = var1.charAt(var8);
            if (var9 == '\r' && var8 + 1 < var2) {
               ++var8;
               var6 = var1.charAt(var8);
               if (var6 != '\n') {
                  var3.append(var6);
               } else {
                  StringBuilder var7 = new StringBuilder();

                  while(true) {
                     ++var8;
                     if (b(var1, var8) <= 0 || b(var1, var8) != ' ') {
                        if (var7.length() > 0) {
                           var3.append(' ');
                        }

                        if (b(var1, var8) != 0) {
                           var3.append(b(var1, var8));
                        }
                        break;
                     }

                     var7.append(' ');
                  }
               }
            } else {
               var3.append(var9);
            }
         }

         return com.aspose.cells.b.a.zr.a(var3);
      }
   }

   private static char b(String var0, int var1) {
      char var2;
      if (var1 < var0.length()) {
         var2 = var0.charAt(var1);
      } else {
         var2 = 0;
      }

      return var2;
   }

   void m() {
      this.S = "";
   }

   void c(String var1) throws Exception {
      var1 = this.l(var1);
      if (this.B) {
         this.T.c(var1);
      } else if (this.A) {
         this.d(var1);
         this.A = false;
      } else if (this.N) {
         this.n = new zafe();
         if ("".equals(this.S)) {
            this.n.a(0);
            this.n.b(var1.length());
         } else {
            this.n.a(this.S.length());
            this.n.b(var1.length());
         }

         if (this.O != null) {
            Font var2 = this.O.getFont();
            this.n.a(var2);
         }

         com.aspose.cells.b.a.a.ze.a(this.m, (Object)this.n);
         this.S = this.S + var1;
         this.N = false;
      } else {
         if (this.z) {
            if (this.F) {
               this.n = new zafe();
               if (!"".equals(this.S)) {
                  this.n.a(this.S.length());
                  this.n.b(var1.length());
               }

               this.S = this.S + var1;
               return;
            }

            if (this.K) {
               this.S = this.S + var1;
               return;
            }

            if (this.C) {
               this.S = this.S + var1;
               this.C = false;
               return;
            }

            this.S = this.S + var1;
         } else if (!var1.trim().equals("") && !this.L()) {
            this.S = this.S + var1;
         }

      }
   }

   private boolean L() {
      Iterator var1 = this.T.d().values().iterator();

      com.aspose.cells.b.a.d.zm var2;
      do {
         if (!var1.hasNext()) {
            return false;
         }

         var2 = (com.aspose.cells.b.a.d.zm)var1.next();
      } while(var2 == null);

      return true;
   }

   void n() {
      if (this.f != null && this.f.h().getHyperlinks().getCount() > 0) {
         HyperlinkCollection var1 = this.f.h().e;
         String var2 = var1.get(var1.getCount() - 1).getAddress();
         String var3 = var1.get(var1.getCount() - 1).getTextToDisplay();
         if ((var2 == null || !var2.equals(var3)) && !var2.equals("http://" + var3)) {
            var1.get(var1.getCount() - 1).setTextToDisplay(var3 + this.m(this.S));
         } else {
            var1.get(var1.getCount() - 1).setTextToDisplay(this.m(this.S));
         }

         this.S = "";
      }

   }

   void o() {
      Cell var1 = this.d();
      if (var1 != null && var1.getValue() == null && !"".equals(this.S)) {
         String var2;
         Style var12;
         if (this.I().getConvertFormulasData()) {
            var2 = this.S.trim();
            if (var2.startsWith("=") && this.X.d(var2)) {
               var1.setFormula(var2);
               ReferredAreaCollection var8 = var1.getPrecedents();
               ReferredArea var9 = var8.getCount() > 0 ? var8.get(0) : null;
               if (null != var9) {
                  if (this.f == null) {
                     this.f = this.F().get(0).getCells();
                  }

                  if (this.f != null && var9.getStartRow() != -1 && var9.getStartColumn() != -1) {
                     Cell var11 = this.f.get(var9.getStartRow(), var9.getStartColumn());
                     var12 = new Style(this.c);
                     var12.copy(this.c.B().a(var1.s()));
                     var12.setCultureCustom(var11.getStyle().getCultureCustom());
                     var1.b(this.c.B().c(var12));
                  }
               }

               this.S = "";
               return;
            }
         }

         if (this.S.toLowerCase().equals("true")) {
            var1.putValue(true);
            this.S = "";
         } else if (this.S.toLowerCase().equals("false") && !var1.f()) {
            var1.putValue(false);
            this.S = "";
         } else {
            var2 = null;
            String var3 = null;
            boolean var4 = true;
            if (" ".equals(this.S)) {
               var3 = this.S;
            } else if (this.S.endsWith(" ") && this.L) {
               var3 = this.m(this.S);
               this.L = false;
            } else {
               var2 = com.aspose.cells.b.a.zv.c(this.S, a);
               if (this.S.startsWith(" ")) {
                  var2 = " " + var2;
               }

               if (this.S.endsWith(" ")) {
                  var2 = var2 + " ";
               }

               var3 = this.m(var2);
               var4 = com.aspose.cells.b.a.zv.b(var2, var3);
            }

            this.S = "";
            if (!"".equals(var3)) {
               try {
                  if (this.q.getConvertNumericData() && var4) {
                     Object var5 = this.R.parseObject(var3.trim());
                     if (var5 != null) {
                        this.a(var1, var5);
                        var12 = var1.getStyle();
                        if (var12.getNumber() == 0 && this.n(var12.getCustom())) {
                           var12.setCustom(this.R.getFormat());
                           var1.a(var12);
                        }

                        return;
                     }
                  }

                  if (this.q.getConvertDateTimeData() && var4) {
                     Style var10 = var1.getStyle();
                     if ("General".equals(var10.getCustom())) {
                        this.a((Cell)var1, (Object)var3);
                        return;
                     }

                     Object var6 = this.Q.parseObject(var3.trim());
                     if (var6 != null && CellsHelper.getDoubleFromDateTime((DateTime)var6, this.b.getSettings().getDate1904()) >= 0.0D) {
                        this.a(var1, var6);
                        var10.setCustom(this.Q.getFormat());
                        var1.a(var10);
                        return;
                     }
                  }

                  this.a((Cell)var1, (Object)var3);
               } catch (Exception var7) {
                  var1.putValue(var3);
               }

            }
         }
      } else {
         this.S = "";
      }
   }

   private void a(Cell var1, Object var2) {
      if (var1.f()) {
         ((zyi)var1.c.d).a(var1, var2);
      } else {
         var1.putValue(var2);
      }

   }

   void p() {
      if (!"".equals(this.S)) {
         Cell var1 = this.d();
         if (var1 != null) {
            String var2 = null;
            String var3 = null;
            if (" ".equals(this.S)) {
               var3 = this.S;
            } else if (this.S.endsWith(" ") && this.L) {
               var3 = this.S;
               this.L = false;
            } else {
               var2 = com.aspose.cells.b.a.zv.c(this.S, a);
               if (this.S.startsWith(" ")) {
                  var2 = " " + var2;
               }

               if (this.S.endsWith(" ")) {
                  var2 = var2 + " ";
               }

               var3 = var2;
            }

            var1.putValue(this.m(var3));
            this.S = "";
         }
      }
   }

   void r(HashMap var1) {
      if (var1.get("class") != null) {
         String var2 = (String)var1.get("class");
         if (this.g.get(var2) == null) {
            return;
         }

         Style var3 = this.c.B().a((Integer)this.g.get(var2));
         Font var4 = new Font(this.c, (Object)null, false);
         var4.c(var3.getFont());
         if (this.I) {
            var4.setStrikeout(true);
            this.I = false;
         }

         if (var1.get("sup") != null) {
            var4.setSuperscript(true);
         }

         if (var1.get("sub") != null) {
            var4.setSubscript(true);
         }

         if (var1.get("s") != null) {
            var4.setStrikeout(true);
         }

         if (this.n.c() > 0) {
            this.n.a(var4);
            com.aspose.cells.b.a.a.ze.a(this.m, (Object)this.n);
         }
      }

      if (var1.get("style") != null) {
         Style var12 = new Style(this.c);
         String var13 = (String)var1.get("style");
         String[] var14 = com.aspose.cells.b.a.zv.d(var13, ';');
         double var5 = -1.0D;

         for(int var7 = 0; var7 < var14.length; ++var7) {
            String var8 = var14[var7];
            String[] var9 = com.aspose.cells.b.a.zv.d(var8, ':');
            String var10 = var9[0].trim();
            String var11 = var9[1].trim().toLowerCase();
            switch(Y.a(var10.toLowerCase())) {
            case 8:
               if ("super".equals(var11)) {
                  var12.getFont().setSuperscript(true);
               }

               if ("sub".equals(var11)) {
                  var12.getFont().setSubscript(true);
               }
               break;
            case 13:
               if (!var11.endsWith("pt") && !var11.endsWith("px") && !var11.endsWith("in")) {
                  if (var11.endsWith("%")) {
                     var11 = var11.substring(0, 0 + (var11.length() - 1));
                     var5 = var12.getFont().getDoubleSize() * (com.aspose.cells.b.a.zn.a(var11) / 100.0D);
                  } else if (var11.endsWith("em")) {
                     var11 = var11.substring(0, 0 + (var11.length() - 2));
                     var5 = var12.getFont().getDoubleSize() * com.aspose.cells.b.a.zn.a(var11);
                  } else if (zaeu.d(var11)) {
                     var5 = var12.getFont().getDoubleSize() * zaeu.e(var11);
                  } else {
                     var5 = zaeu.b(var11);
                  }
                  break;
               }

               var5 = zaeu.b(var11);
               break;
            case 14:
               zaeu.a(var11, var12.getFont());
               break;
            case 15:
               if ("bold".equals(var11.toLowerCase())) {
                  this.O.getFont().setBold(true);
               }
               break;
            case 34:
               if ("underline".equals(var11)) {
                  this.O.getFont().setUnderline(zaer.f(var11));
               } else if ("line-through".equals(var11)) {
                  this.O.getFont().setStrikeout(true);
               }
            case 45:
            }
         }

         if (!var12.getFont().isSubscript() && !var12.getFont().isSuperscript() && var5 > -1.0D) {
            var12.getFont().setDoubleSize(var5);
         }

         if (this.n.c() > 0) {
            this.n.a(var12.getFont());
            com.aspose.cells.b.a.a.ze.a(this.m, (Object)this.n);
         }
      }

   }

   void q() {
      Cell var1 = this.d();
      Style var2 = var1.getStyle();
      var2.getFont().setSuperscript(true);
      var1.a(var2);
   }

   void r() {
      Cell var1 = this.d();
      Style var2 = var1.getStyle();
      var2.getFont().setSubscript(true);
      var1.a(var2);
   }

   void s() {
      Cell var1 = this.d();
      Style var2 = var1.getStyle();
      var2.getFont().setUnderline(1);
      var1.a(var2);
   }

   void t() {
      Cell var1 = this.d();
      if (var1 != null) {
         Style var2 = var1.getStyle();
         var2.getFont().setBold(true);
         var1.a(var2);
      }
   }

   void u() {
      Cell var1 = this.d();
      if (var1 != null) {
         Style var2 = var1.getStyle();
         var2.getFont().setItalic(true);
         var1.a(var2);
      }
   }

   void v() {
      Cell var1 = this.d();
      Style var2 = var1.getStyle();
      var2.getFont().setStrikeout(true);
      var1.a(var2);
   }

   void c(boolean var1) {
      this.G = var1;
   }

   void d(boolean var1) {
      this.H = var1;
   }

   void e(boolean var1) {
      this.J = var1;
   }

   void f(boolean var1) {
      this.E = var1;
   }

   void g(boolean var1) {
      this.F = var1;
   }

   void w() {
      this.n = new zafe();
   }

   private String m(String var1) {
      if (var1.indexOf("&") > -1) {
         var1 = zadt.a(var1);
      }

      return var1;
   }

   void d(String var1) {
      BuiltInDocumentPropertyCollection var2 = this.c.getBuiltInDocumentProperties();

      try {
         var2.setTitle(var1);
      } catch (Exception var4) {
         ;
      }

   }

   private void a(Object var1, Cell var2) {
   }

   private void a(int var1, int var2, int var3, int var4, CellArea[] var5) {
      var5[0].StartRow = var1;
      var5[0].StartColumn = var2;
      var5[0].EndRow = var3;
      var5[0].EndColumn = var4;
   }

   void x() {
      if (this.v > 0 && this.u == 0) {
         this.s += this.v - 1;
         this.v = 0;
      }

   }

   private void M() {
      if (this.k.size() > this.l) {
         zaey var1 = new zaey();
         Collections.sort(this.k, var1);
         this.l = this.k.size();
      }

      for(int var3 = 0; var3 < this.k.size(); ++var3) {
         CellArea var2 = (CellArea)this.k.get(var3);
         if (this.r >= var2.StartRow && this.r <= var2.EndRow) {
            if (this.s == var2.StartColumn) {
               this.s += var2.EndColumn - var2.StartColumn + 1;
            } else if (this.s >= var2.StartColumn && this.s <= var2.EndColumn) {
               this.s += var2.EndColumn - var2.StartColumn;
            }
         }
      }

   }

   private void a(Object var1, Cell var2, HashMap var3) {
      if (var1 != null) {
         String var4 = (String)var1;
         var4 = this.m(var4);
         this.D = true;
         String var5 = (String)var3.get("x:arrayrange");

         try {
            if (var5 != null) {
               this.a(var5, var4, var2);
            } else {
               var2.setFormula(var4);
            }
         } catch (Exception var7) {
            ;
         }
      } else {
         this.D = var2.f();
      }

   }

   private void a(String var1, String var2, Cell var3) {
      String[] var4 = com.aspose.cells.b.a.zv.d(var1, ':');
      if (var4.length > 1) {
         int var5 = zaez.a(var4[1]) - zaez.a(var4[0]) + 1;
         int var6 = zaez.b(var4[1]) - zaez.b(var4[0]) + 1;
         var3.a(this.m(var2), var5, var6);
      } else {
         var3.a((String)this.m(var2), 1, 1);
      }

   }

   private boolean n(String var1) {
      return var1 == null || "".equals(var1);
   }

   private void b(Object var1, Cell var2) {
      if (null != var1) {
         String var3 = (String)var1;
         if (var3.length() != 0) {
            if (zaer.a(var3) == zaer.a) {
               if (this.D) {
                  var2.a((Object)com.aspose.cells.b.a.ze.g(var3), (byte)2);
               } else {
                  var2.putValue(com.aspose.cells.b.a.ze.g(var3));
               }
            } else if (this.D) {
               var2.a((Object)com.aspose.cells.b.a.ze.f(var3), (byte)2);
            } else {
               var2.putValue(com.aspose.cells.b.a.ze.f(var3));
            }

         }
      }
   }

   void y() {
      com.aspose.cells.b.a.a.zc var1 = com.aspose.cells.b.a.a.zf.a(this.P);

      while(var1.c()) {
         this.f.setColumnWidthPixel((Integer)var1.a(), (Integer)var1.b());
      }

      this.P.clear();
   }

   void z() {
      this.s = -1;
      this.r = -1;
      this.t = 0;
      this.D();
      this.m.clear();
      this.P.clear();
   }

   void A() {
      this.m.clear();
      this.n.b(0);
   }

   int B() {
      return this.m.size();
   }

   void C() {
      Cell var1 = this.d();
      if (var1.getType() == 5) {
         for(int var2 = 0; var2 < this.m.size(); ++var2) {
            zafe var3 = (zafe)this.m.get(var2);
            if (var3.c() != this.S.length() || var1.getType() != 4) {
               FontSetting var4 = var1.characters(var3.b(), var3.c());
               var3.a().d(var1.getStyle().getFont());
               var4.a(var3.a());
            }
         }

      }
   }

   void D() {
      this.k.clear();
   }

   void h(boolean var1) {
      this.z = var1;
   }

   Worksheet E() {
      return this.d;
   }

   void a(Worksheet var1) {
      this.d = var1;
      this.f = this.d.getCells();
      this.e = null;
   }

   void a(Cells var1) {
      this.f = var1;
   }

   WorksheetCollection F() {
      return this.c;
   }

   Workbook G() {
      return this.b;
   }

   HashMap H() {
      return this.g;
   }

   void s(HashMap var1) {
      this.g = var1;
   }

   void b(int var1) {
      this.y = var1;
   }

   void t(HashMap var1) {
      this.h = var1;
   }

   HTMLLoadOptions I() {
      return this.q;
   }

   void a(HTMLLoadOptions var1) {
      this.q = var1;
      if (this.q.getConvertFormulasData()) {
         this.X = new com.aspose.cells.b.a.g.a.ze("^\\=\\S+\\(\\S+\\)$");
      }

   }

   void u(HashMap var1) {
      Object var2 = var1.get("class");
      if (var2 == null) {
         var2 = var1.get("CLASS");
      }

      int var3 = 15;
      if (var2 != null && this.g != null && this.g.containsKey((String)var2)) {
         var3 = (Integer)this.g.get((String)var2);
      }

      Style var4 = null;
      if (var3 != 15) {
         var4 = this.F().B().a(var3);
      }

      Cell var5 = this.d();
      if (var5 != null && var4 != null) {
         var5.a(var4);
      }
   }

   void J() {
      if (this.f == null) {
         this.f = this.F().get(0).getCells();
      }

      if (this.f != null && this.r != -1) {
         this.f.merge(this.r, 0, 1, 18);
      }

   }
}
